﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace MessageWorkflow.Graph
{
    public class AdjacencyListGraphNode<T>
    {
        private List<T> _dependencies;

        public T Value { get; set; }

        public ICollection<T> Dependencies
        {
            get
            {
                if (_dependencies == null)
                {
                    _dependencies = new List<T>();
                }

                return _dependencies;
            }
        }

        public bool Equals(AdjacencyListGraphNode<T> other)
        {
            if (other != null)
            {
                return object.Equals(Value, other.Value);
            }
            else
            {
                return false;
            }
        }
    }
}
